package com.yky.config;

import com.yky.vo.Result;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * 业务聚合
 *
 * @version [V2.0]
 * @package com.example.sso.clientA;
 * @description:[用一句话描述该文件做什么]
 * @author: [zhuben]
 * @date: [2024-02-21 10:44]
 * @copyright: 2024 echovin.com
 */

@RestControllerAdvice
public class GlobalExceptionHandler {
    private static final Logger log = LoggerFactory.getLogger(GlobalExceptionHandler.class);
    @ExceptionHandler
    public Result handlerException(Exception e) {
        log.error("~^~ ~^~ ~^~ 系统错误", e);
        return Result.error(e.getMessage());
    }
}
